#include <stdio.h>
int main()
{
	int a=0,c=0,y=0;
	scanf("%d %d",&a,&c);
	y=(-8+22)*a-10+c/2;
	printf("%d",y);
	return 0;
}